<template>
    <div class="ring" :style="`width:${width}px ;height:${width}px`">
        <el-progress type="circle" :show-text="false" :stroke-width="5" color="rgba(57, 210, 45, 1)" define-back-color="rgba(0, 34, 125, 1)" :width="93" :percentage="info.surplus">
        </el-progress>
        <div class="content"  :style="`color:${info.surplus > 10 ? 'RGBA(49, 239, 129, 1)' : 'RGBA(255, 0, 0, 1)'};`">
            <div class="count" >{{ info.surplus }}</div>%
        </div>
        <div class="ring-bg"></div>
    </div>
</template>
<script>
export default {
    props: {
        width: {
            default: 93
        },
        info: {
            default: () => {
                return {
                    surplus: 0
                }
            },
        },
    },

    data() {
        return {};
    },
};
</script>
<style lang="scss" scoped>
.ring {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;

    .content {
        position: absolute;
        left: 10px;
        top:10px;
        right: 10px;
        bottom: 10px;
        border: 1px solid #91A9FF;
        border-radius: 50%;
        font-size: 21px;
        font-family: MicrosoftYaHei;
        display: flex;
        justify-content: center;
        align-items: center;
        // box-shadow: 0px 0px 10px 2px RGBA(4, 60, 168, 1);
        box-sizing: border-box;

        .count {
            font-weight: 700;
        }
    }

    .ring-bg {
        position: absolute;
        left: 0px;
        right: 0px;
        top: 0px;
        bottom: 0px;
        border: 1px solid #00227D;
        border-radius: 50%;
        box-sizing: border-box;
        box-shadow: 0px 0px 10px 6px RGBA(4, 60, 168, 1);
    }
}
</style>